/**
 * Created by plter on 2016/11/17.
 */


(function () {


    var canvas = document.querySelector("#canvas");
    var context = canvas.getContext("2d");
    var video = document.querySelector("#video");

    function redrawVideo() {

        context.clearRect(0, 0, canvas.width, canvas.height);
        context.drawImage(video, 0, 0);
    }

    function render() {
        redrawVideo();

        requestAnimationFrame(render);
    }

    render();
})();